import Shell from 'gi://Shell';
import St from 'gi://St';
-import * as Main from './main.js';
import * as MessageList from './messageList.js';
import * as PopupMenu from './popupMenu.js';
import {ensureActorVisibleInScrollView} from '../misc/animationUtils.js';
this._notificationSection = new MessageList.NotificationSection();
this._addSection(this._notificationSection);
-
- Main.sessionMode.connect('updated', this._sync.bind(this));
}
_addSection(section) {
_sync() {
let sections = this._sectionList.get_children();
- let visible = sections.some(s => s.allowed);
- this.visible = visible;
- if (!visible)
- return;
let empty = sections.every(s => s.empty || !s.visible);
this._placeholder.visible = empty;
// but the corresponding app (clocks, weather); however we can consider
// that display-specific settings, so re-use "allowSettings" here ...
this._displaysSection.visible = Main.sessionMode.allowSettings;
+
+ this._messageList.visible = Main.sessionMode.hasNotifications && !Main.sessionMode.isGreeter;
}
});
this.emit('message-focused', messageActor);
}
- get allowed() {
- return true;
- }
-
addMessage(message, animate) {
this.addMessageAtIndex(message, -1, animate);
}
}
}
- _shouldShow() {
- return !this.empty;
- }
-
_sync() {
let messages = this._messages;
let empty = messages.length === 0;
this.notify('can-clear');
}
- this.visible = this.allowed && this._shouldShow();
+ this.visible = !this.empty;
}
});
});
}
- get allowed() {
- return Main.sessionMode.hasNotifications &&
- !Main.sessionMode.isGreeter;
- }
-
_sourceAdded(tray, source) {
source.connectObject(
'notification-added', this._onNotificationAdded.bind(this),
this._players.delete(player);
}
-
- get allowed() {
- return !Main.sessionMode.isGreeter;
- }
});